home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / _cmpdf2.s < prev    next >
Text File  |  1992-05-17  |  916b  |  57 lines

  1. | double floating point compare routine
  2. |
  3. | written by Kai-Uwe Bloem (I5110401@dbstu1.bitnet).
  4. | Based on a 80x86 floating point packet from comp.os.minix, written by P.Housel
  5. |
  6. |
  7. | Revision 1.1, kub 12-89 :
  8. | Ported over to 68k assembler
  9. |
  10. | Revision 1.0:
  11. | original 8088 code from P.S.Housel
  12.  
  13.     .text
  14.     .even
  15.     .globl    __cmpdf2, ___cmpdf2
  16.     | additional entry points for gcc2
  17.     .globl    ___eqdf2, ___nedf2, ___gtdf2, ___gedf2, ___ltdf2, ___ledf2
  18.  
  19. __cmpdf2:
  20. ___cmpdf2:
  21. ___eqdf2:
  22. ___nedf2:
  23. ___gtdf2:
  24. ___gedf2:
  25. ___ltdf2:
  26. ___ledf2:
  27.     moveml    sp@(4),d0-d1/a0-a1 | get u and v
  28.     tstl    d0        | check sign bit
  29.     bpl    1f
  30.     negl    d1        | negate
  31.     negxl    d0
  32.     eorl    #0x80000000,d0    | toggle sign bit
  33. 1:
  34.     exg    a0,d0
  35.     exg    a1,d1
  36.     tstl    d0        | check sign bit
  37.     bpl    2f
  38.     negl    d1        | negate
  39.     negxl    d0
  40.     eorl    #0x80000000,d0    | toggle sign bit
  41. 2:
  42.     cmpl    d0,a0
  43.     blt    lt
  44.     bgt    gt
  45.     cmpl    d1,a1
  46.     bhi    gt
  47.     beq    eq
  48. lt:
  49.     moveq    #-1,d0
  50.     rts
  51. eq:
  52.     clrl    d0
  53.     rts
  54. gt:
  55.     moveq    #1,d0
  56.     rts
  57.